<template>
  <section>
    <div v-if="processList && processList.length > 1">
      <template v-for="(item, index) in processList">
        <div :key="index"
             class="tableSty">
          <el-row :gutter="20"
                  class="tableHead">
            <el-col :span="6">
              <div class="labelSty">{{ `拆分运单${index + 1}` }}</div>
              <icon-svg icon-name="zuoshangjiao"
                        class-name="iconSty" />
            </el-col>
            <el-col :span="6"
                    class="ml160">物品名称</el-col>
            <el-col :span="6">物品型号</el-col>
            <el-col :span="6">件数</el-col>
          </el-row>
          <template v-for="(option, i) in item.info">
            <el-row :key="i"
                    :gutter="20"
                    class="tableItem">
              <el-col :span="6"
                      class="ml160">
                <span :title="option.goodsName"
                      class="ellipsis">{{option.goodsName}}</span>
              </el-col>
              <el-col :span="6">
                <span :title="option.spec"
                      class="ellipsis">{{option.spec}}</span>
              </el-col>
              <el-col :span="6">{{option.num}}</el-col>
            </el-row>
          </template>
          <el-row :gutter="20"
                  class="tablefooter">
            <el-col :span="6"
                    class="ml160">
              合计体积：{{ item.childVolumn }}立方米
            </el-col>
            <el-col :span="6"> 合计重量：{{ item.childWeight }}公斤 </el-col>
            <el-col :span="6"> 合计件数：{{ item.childNum }}件 </el-col>
          </el-row>
        </div>
      </template>
    </div>
    <div v-else
         class="centerSty">
      <div class="textCenter">
        <img src="../../../../static/images/no_data.png"
             width="240px"
             height="164px" />
        <p class="fontSty">暂无数据</p>
      </div>
    </div>
  </section>
</template>

<script>
export default {
  name: "DispatchDetails",
  props: {
    processList: {
      type: Array,
      default: () => []
    }
  },
  data () {
    return {};
  },
  methods: {
    handleChange (val) {
      console.log(val);
    }
  }
};
</script>

<style lang="scss" scoped>
.tableSty {
  margin-bottom: 20px;
}
.tableHead {
  background: #fafafa;
  height: 50px;
  line-height: 50px;
}
.tableItem {
  height: 50px;
  line-height: 50px;
  color: var(--prev-color-text-ashes);
}
.tablefooter {
  background: var(--prev-bg-lightgrey);
  height: 50px;
  line-height: 50px;
  color: var(--prev-color-primary);
}
.iconSty {
  width: 80px;
  height: 30px;
  position: absolute;
  left: 10px;
  top: 0;
  margin: 0;
}
.labelSty {
  position: absolute;
  left: 15px;
  top: -10px;
  z-index: 2;
  color: var(--prev-bg-white);
}
.ml160 {
  margin-left: 160px;
}

.splitorder-info {
  font-size: 14px;
  margin: 15px 20px;
  padding: 15px 35px 15px 0px;
  background: rgba(250, 250, 250, 0.39);
  display: flex;
  justify-content: space-between;
  align-items: center;
  .left {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
  }
  .right {
    color: var(--prev-color-text-purered);
  }
  .from {
    margin: 0 20px 0 150px;
    min-width: 320px;
  }
  .iconSty-1 {
    width: 66px;
    height: 15px;
  }
}
p {
  margin: 0;
}
.mlr20 {
  margin: 0 20px;
}
.line-herger28 {
  line-height: 28px;
}
.centerSty {
  display: flex;
  justify-content: center;
  align-items: center;
}
.fontSty {
  font-size: 18px;
  font-weight: 400;
  line-height: 25px;
  color: var(--prev-color-text-darkgrey);
}
.textCenter {
  text-align: center;
}
.grey {
  color: var(--prev-border-color-lightgrey);
}
</style>
